package com.ferret.dao;

import com.ferret.bean.entity.RyGzryxxcj;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface RyGzryxxcjDao extends JpaRepository<RyGzryxxcj, String>, JpaSpecificationExecutor<RyGzryxxcj> {

    @Query(value = "select r.* from RY_GZRYXXCJ r  where  r.ryzt='1'", nativeQuery = true)
    List<RyGzryxxcj> findAllByZkry();

    @Query(value = "select r.* from RY_GZRYXXCJ r  where r.gmsfhm=?1 and r.ryzt='1' and r.djdw LIKE '%'||?2||'%'", nativeQuery = true)
    List<RyGzryxxcj> findAllByGmsfhm(@Param("gmsfhm") String gmsfhm,@Param("regionalCode") String regionalCode);

}
